import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QVBoxLayout, QWidget, QPushButton

class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()

        self.setWindowTitle("嵌入式上位机界面")

        layout = QVBoxLayout()

        self.label = QLabel("嵌入式设备状态：未连接")
        layout.addWidget(self.label)

        self.connect_button = QPushButton("连接设备")
        self.connect_button.clicked.connect(self.connect_device)
        layout.addWidget(self.connect_button)

        self.disconnect_button = QPushButton("断开设备")
        self.disconnect_button.clicked.connect(self.disconnect_device)
        layout.addWidget(self.disconnect_button)

        container = QWidget()
        container.setLayout(layout)
        self.setCentralWidget(container)

    def connect_device(self):
        self.label.setText("嵌入式设备状态：已连接")

    def disconnect_device(self):
        self.label.setText("嵌入式设备状态：未连接")

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = MainWindow()
    window.show()
    sys.exit(app.exec_())